<?php
function isOpenSession(){
    if (php_sapi_name() !== 'cli') {
        if (version_compare(phpversion(), '5.4.0', '>=')) {
            return session_status() === PHP_SESSION_ACTIVE ? true : false;
        } else {
            return session_id() === '' ? false : true;
        }
    }
    return false;
}

if (!isOpenSession()){
    session_start();
}
if ($_SESSION['id']){
    Header("Location:./info.html");
}else{
    Header("Location:./login.html");
}
